package org.flashbrighton.as3bots.components
{
	import org.flashbrighton.as3bots.bots.BaseBot;
	import org.flashbrighton.as3bots.models.BotModel;
	
	
	public class HealthComponent implements IComponent
	{
		public static const MAX_ENERGY:int = 1000;
		
		
		public function HealthComponent()
		{
		}
		
		
		public function update(bot:BaseBot, botModel:BotModel):void
		{
			deductHealth(botModel, botModel.damage);
			botModel.damage = 0;
		}
		
		
		public function deductHealth(botModel:BotModel, amount:int=0):void
		{			
			botModel.energy += amount;
		}

	}
}